package com.example.cas.controller;

import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author : LCheng
 * @date : 2020-11-26 17:44
 * description : 测试控制器
 */
@Slf4j
@RestController
public class TestController {

    @SneakyThrows
    @GetMapping(value = "/login")
    public String login(HttpServletRequest request, HttpServletResponse response) {
        //只是为了跳转到cas服务端的登录页面  登录成功后会跳回此页
        //可根据自身系统进行代码增强
        return "登录成功了";
    }

    @GetMapping(value = "/logout")
    public void logout() {
        //只是为了跳转到cas服务端的登出页面
        //可根据自身系统进行代码增强
    }

    @GetMapping(value = "/hello")
    public String hello() {
    	//登录成功后，访问此接口，如果正常返回hello word，表示已授权成功
        return "hello word";
    }
}
